package com.sxj.shop.service;

import com.sxj.shop.entity.User;
import com.sxj.shop.exception.*;

public interface UserService {

    /**
     * 用户注册,密码需要使用MD5加密后存储到数据库
     * 用户名不能重复
     * @param username
     * @param password
     * @param phone
     * @param address
     */
    void register(String username,String password,String phone,String address) throws RequestParameterErrorException, UserExistException;

    /**
     * 用户登录,密码需要使用MD5加密后进入数据库查询
     * @param username
     * @param password
     * @return
     */
    User login(String username, String password) throws RequestParameterErrorException, UserNotExistException;

    void modifyPassword(User user,String oldPassword,String newPassword,String newPassword2) throws UserNotLoginException, RequestParameterErrorException, PasswordErrorException;

}
